package spring.angularjs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="/file")
public class FileUploadController {

	@RequestMapping(value="/start")
	public String goFilePartialPage(){
		return "fileupload/layout";
	}
	
	@RequestMapping(value="/upload", method=RequestMethod.POST)
	@ResponseBody
	public void uploadFile(){
		// not thing to do here
	}
	
	@RequestMapping(value="/data", method=RequestMethod.POST)
	@ResponseBody
	public byte[] sendImageToDatabase(@RequestBody byte[] data){
		return data;
	}
	
}
